package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.dto.LoginDto;
import com.itheima.service.EmpService;
import com.itheima.vo.LoginVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class LoginController {
    @Autowired
    EmpService empService;
    @PostMapping("/login")
    public R login(@RequestBody LoginDto dto){
       LoginVo vo =empService.login(dto);
       return R.ok(vo);
    }
}
